package edu.nf.takeoutdemo.model.converter;

import edu.nf.takeoutdemo.model.dto.OrderSubmitDTO;
import edu.nf.takeoutdemo.model.entity.Orders;
import edu.nf.takeoutdemo.model.vo.OrderVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 *
 * @author zjl
 * @date 2025/10/30
 */
@Mapper(componentModel = "spring")
public interface OrderConverter {

    @Mappings({
            @Mapping(source = "addressBookId",target = "addressBookId"),
            @Mapping(source = "payMethod",target = "payMethod"),
            @Mapping(source = "remark",target = "remark"),
            @Mapping(source = "estimatedDeliveryTime",target = "estimatedDeliveryTime"),
            @Mapping(source = "deliveryStatus",target = "deliveryStatus"),
            @Mapping(source = "tablewareStatus",target = "tablewareStatus"),
            @Mapping(source = "tablewareNumber",target = "tablewareNumber"),
            @Mapping(source = "packAmount",target = "packAmount"),
            @Mapping(source = "amount",target = "amount")
    })
    Orders toOrders(OrderSubmitDTO orderSubmitDTO);

    // todo
//    OrderVO toOrderVO();
}
